<template>
  <div>
    <h4>学分记录</h4>
    <el-divider></el-divider>
    <el-scrollbar style="height:300px">
      <el-timeline :reverse="true">
        <el-timeline-item v-for="(item, index) in dataList" :timestamp="item.judge_Time" placement="top"
                          :color="index===dataList.length - 1 ? '#0bbd87' : ''" :key="index">
          <el-card>
            <h4 class="task-title">您的这次学分申请理由为：{{ item.reason }}</h4>
            <p class="task-content">您的这次学分申请成功，学分变为：{{ item.after_changeCre }}</p>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </el-scrollbar>
  </div>
</template>

<script lang="ts">
// import { getTeachNotice } from 'network/student/getTeachNotice'
// import { timeTranslate } from 'common/timeTranslate'
import {getCurrentInstance} from "vue";
import {getApplyList} from "@/network/student/getApplyList";

export default {
  name: 'Notice',
  data() {
    return {
      dataList: [{
        judge_Time: '2020/6/1 6:30',
        reason: '欢迎使用区块链学分系统',
        after_changeCre: '暂无学分记录，等待团支书更新哦！！！'
      },
        {
          judge_Time: '2021/6/1 6:30',
          reason: '欢迎使用区块链学分系统',
          after_changeCre: '暂无学分记录，等待团支书更新哦！！！'
        }]
    }
  },
  setup(){
    const {proxy}:any=getCurrentInstance();
    const id = localStorage.getItem('StudentId')
    getApplyList(id).then(result=>{
      console.log(result.data.result)

      proxy.dataList=result.data.result
    }).catch(err=>{

    })
  }
}
</script>

<style scoped>
.scrollbar {
  height: 300px;
}

.see-more {
  margin: .5em;
  text-align: right;
}

.task-title {
  padding-bottom: 1em;
}

.task-content {
  padding-bottom: 2em;
  line-height: 1.4em;
}
</style>
